/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author jackie
 */
@Entity
public class Quotation implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private Double totalAmount;
    private Integer leadTime;
    private String status; //affected by validity or converted to sales order
    private Timestamp creationDate;
    private String remark;
    @OneToMany(cascade = {CascadeType.ALL}, fetch=FetchType.EAGER)
    private List<QuotationItem> quotationItems = new ArrayList<QuotationItem>();
    @OneToOne(cascade = {CascadeType.PERSIST}, fetch=FetchType.EAGER)
    private Inquiry inquiry;
    private Double subTotal; //total item costs
    private Double totalShipping; //total item shipping costs
    
    public Quotation(){
        
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the Amount
     */
    public Double getTotalAmount() {
        return totalAmount;
    }

    /**
     * @param Amount the Amount to set
     */
    public void setTotalAmount(Double totalAmount) {
        this.totalAmount = totalAmount;
    }

    /**
     * @return the leadTime
     */
    public Integer getLeadTime() {
        return leadTime;
    }

    /**
     * @param leadTime the leadTime to set
     */
    public void setLeadTime(Integer leadTime) {
        this.leadTime = leadTime;
    }

    /**
     * @return the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * @return the creationDate
     */
    public Timestamp getCreationDate() {
        return creationDate;
    }

    /**
     * @param creationDate the creationDate to set
     */
    public void setCreationDate(Timestamp creationDate) {
        this.creationDate = creationDate;
    }

    /**
     * @return the remark
     */
    public String getRemark() {
        return remark;
    }

    /**
     * @param remark the remark to set
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

    /**
     * @return the quotationItems
     */
    public List<QuotationItem> getQuotationItems() {
        return quotationItems;
    }

    /**
     * @param quotationItems the quotationItems to set
     */
    public void setQuotationItems(List<QuotationItem> quotationItems) {
        this.quotationItems = quotationItems;
    }

    /**
     * @return the inquiryId
     */
    public Inquiry getInquiry() {
        return inquiry;
    }

    /**
     * @param inquiryId the inquiryId to set
     */
    public void setInquiry(Inquiry inquiry) {
        this.inquiry = inquiry;
    }

    /**
     * @return the subTotal
     */
    public Double getSubTotal() {
        return subTotal;
    }

    /**
     * @param subTotal the subTotal to set
     */
    public void setSubTotal(Double subTotal) {
        this.subTotal = subTotal;
    }

    /**
     * @return the totalShipping
     */
    public Double getTotalShipping() {
        return totalShipping;
    }

    /**
     * @param totalShipping the totalShipping to set
     */
    public void setTotalShipping(Double totalShipping) {
        this.totalShipping = totalShipping;
    }
}
